<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/24 0024
  Time: 19:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath();%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%--
<script src="<%=path%>/static/js/jquery-3.5.1.min.js"></script>
--%>

<style>
    #hide{
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        position: fixed;
        background-image: url("<%=path%>/static/web/css/img/overlay.png");
        opacity: 1;
        z-index: 100;
        display: none;
    }
    #hide #mes{
        margin: 0;
        padding: 0;
        width: 40%;
        height: 55%;
        position: absolute;
        left: 25%;
        top: 15%;
        z-index: 120;
        border: #3a3a3a 8px solid;
        background-color: #cccccc;
        overflow: auto;
    }
    #hide #mes #header{
        margin: 0;
        padding: 0;
        background-color:#019875;
        height: 50px;
        z-index: 150;
        color: white;
    }
    #hide #mes #header #but{
        position: relative;
        background-image: url("<%=path%>/static/web/css/img/controls.png");
        width: 30px;
        height: 30px;
        float: right;
        border:#019875 0px solid;
    }
    #hide #mes #header #but:hover{
        cursor: pointer;
    }
    #hide #mes #header #title{
        font-size: 25px;

    }
    #hide #mes div {
        text-align: center;
        margin-top: 10px;
        padding: 0;
        height: 50px;
        z-index: 150;
        color: #0C0C0C;
        font-size: 20px;
    }
    #hide #mes #ok{
        margin-top: 40px;
    }
    #hide #mes #ok input:hover{
        cursor: pointer;
        color: #019875;
    }
</style>
<script>
    $(function () {
        $("#but").click(function () {
            $("#hide").css("display","none");
        });
    });
    $(function () {
        $("#button").click(function () {
            var set = $("#set").val();
            var def = $("#def").val();
            var description = $("#descrip").val();
            var flag = /^\d$/;
            if (!flag.test(set)||!flag.test(def)){
                alert("输入有误");
                return;
            }
            if (set==""||def==""||description==""){
                alert("不能为空");
                return;
            }
            $.get("<%=path%>/manage/config/setValue",{value:set,defaultValue:def,id:${requestScope.config.id},description:description},function () {
                location.reload();
                $("#hide").css("display","none");
            });

        });
    });
</script>
<div id="hide">
    <div id="mes">
        <div id="header">
            <span id="title">详细信息</span>
            <button id="but"></button>
        </div>
        <div id="detailed">
            <span>描述:&nbsp;${requestScope.config.description}</span>
        </div>
        <div id="like">
            <span>设置值:&nbsp;</span>
            <input type="number" id="set" value="${requestScope.config.value}">
        </div>
        <div id="education">
            <span>默认值:&nbsp;</span>
            <input type="number" id="def" value="${requestScope.config.defaultValue}">
        </div>
        <div id="description">
            <span>写描述:&nbsp;</span>
            <input type="text" id="descrip" value="${requestScope.config.description}">
        </div>
        <div id="ok">
            <span style="margin-left: 10px">
                <input type="button" id="button" value="确定修改">
            </span>
        </div>
    </div>
</div>

